package com.kfm.wiki.controller;

import com.kfm.wiki.entity.Test;
import com.kfm.wiki.service.TestService;
import com.kfm.wiki.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 10854
 */
@RestController
public class HelloController {

    @Autowired
    private TestService testService;

    /*
        GET POST DELETE PUT
        GetMapping()
        PostMapping()
     */
    @RequestMapping(value= "/hello", method = RequestMethod.GET)
    public String hello(){
        return "hello2222";
    }


    @PostMapping("/post")
    public String postHello(){
        return "post";
    }

    @GetMapping("/list")
    public R list(){
        return R.ok(testService.findAll());
    }
}
